package com.gw2.gw2world.web.server.cron;

import org.springframework.stereotype.Repository;
import org.springframework.scheduling.annotation.Scheduled;
import com.gw2.gw2world.web.server.EventManager;

@Repository("eventUpdaterJob")
public class EventUpdater {
	private EventManager eventManager;

	@Scheduled(cron = "0/30 * * * * ?")
	public void execute() {
		if(eventManager==null)
			setEventManager(new EventManager());
		org.apache.log4j.Logger.getLogger("com.gw2.gw2world.web.server.cron").info("Refreshing events...");
		eventManager.toString();
	}

	public void setEventManager(EventManager em) {
		eventManager = em;
	}
}
